Port security on a Cisco switch is a feature that enhances network security by controlling and restricting the number of MAC (Media Access Control) addresses that can be learned or allowed on a specific switch port. This prevents unauthorized devices from connecting to the network via switch ports.
(config)# interface range [port]
(config-if)# switchport mode access
(config-if)# switchport port-security
(config-if)# switchport port-security maximum [number]
(config-if)# switchport port-security mac-address sticky
(config-if)# switchport port-security violation restrict
# show port-security
# show port-security address